package com.item.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@TableName("userinfo")
@NoArgsConstructor
@AllArgsConstructor
@RequiredArgsConstructor
public class UserInfo implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer uid;

    @NonNull
    private String uname;

    @NonNull
    private String mailbox;

    @NonNull
    private String password;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date age;

    private Integer sex;

    private String phone;

    private String address;

    @TableField("headportrait")
    private String headPortrait;

    private String desc;

    private String education;

    private Integer status;

    private String nation;

    private Double salary;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("hiredate")
    private Date hireDate;

    private Integer pid;
}
